<?php 
$this->breadcrumbs[Controller::getServiceType($st_id)] = array();
if (isset($rubric['name'])) {
	$this->breadcrumbs[GxHtml::encode($rubric['name'])] = array();	
}
?>

<?php if (0 < count($rubric)):?>
<div class="row-fluid">
	<?php if(0 < count($rubric['categories'])):?>
	<div class="span3">
		<ul class="unstyled">
			<?php $i = 0; ?>
			<?php foreach($rubric['categories'] as $category):?>
			<?php if(0 == $i%4):?>
			<li><a href="<?php echo Yii::app()->createUrl('/category', array('st_id' => $st_id,'rid'=>$rubric['id'], 'cid'=>$category['id']));?>"><?php echo GxHtml::encode($category['name']); ?></a><?php if('' != $category['description']):?><br /><small>(<?php echo GxHtml::encode($category['description']);?>)</small><?php endif;?></li>
			<?php endif;?>
			<?php $i++; ?>
			<?php endforeach;?>
		</ul>
	</div>
	
	<div class="span3">
		<ul class="unstyled">
			<?php $i = 0; ?>
			<?php foreach($rubric['categories'] as $category):?>
			<?php if(1 == $i%4):?>
			<li><a href="<?php echo Yii::app()->createUrl('/category', array('st_id' => $st_id,'rid'=>$rubric['id'], 'cid'=>$category['id']));?>"><?php echo GxHtml::encode($category['name']); ?></a><?php if('' != $category['description']):?><br /><small>(<?php echo GxHtml::encode($category['description']);?>)</small><?php endif;?></li>
			<?php endif;?>
			<?php $i++; ?>
			<?php endforeach;?>
		</ul>
	</div>
	
	<div class="span3">
		<ul class="unstyled">
			<?php $i = 0; ?>
			<?php foreach($rubric['categories'] as $category):?>
			<?php if(2 == $i%4):?>
			<li><a href="<?php echo Yii::app()->createUrl('/category', array('st_id' => $st_id,'rid'=>$rubric['id'], 'cid'=>$category['id']));?>"><?php echo GxHtml::encode($category['name']); ?></a><?php if('' != $category['description']):?><br /><small>(<?php echo GxHtml::encode($category['description']);?>)</small><?php endif;?></li>
			<?php endif;?>
			<?php $i++; ?>
			<?php endforeach;?>
		</ul>
	</div>
	
	<div class="span3">
		<ul class="unstyled">
			<?php $i = 0; ?>
			<?php foreach($rubric['categories'] as $category):?>
			<?php if(3 == $i%4):?>
			<li><a href="<?php echo Yii::app()->createUrl('/category', array('st_id' => $st_id,'rid'=>$rubric['id'], 'cid'=>$category['id']));?>"><?php echo GxHtml::encode($category['name']); ?></a><?php if('' != $category['description']):?><br /><small>(<?php echo GxHtml::encode($category['description']);?>)</small><?php endif;?></li>
			<?php endif;?>
			<?php $i++; ?>
			<?php endforeach;?>
		</ul>
	</div>
	<?php endif;?>
</div>
<?php else:?>
<p><?php echo Yii::t('app', 'Записи не найдены');?></p>
<?php endif;?>